home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / mg / rexx / flen.mg < prev    next >
Text File  |  1995-03-09  |  508b  |  32 lines

  1. /* Search for lines of the specified minimum lenght */
  2. /* Handles TABs correctly                */
  3. options results
  4.  
  5. 'rexx-request "Line length: "'
  6. len=result
  7. foo=0
  8. do until foo~=0
  9.     'rexx-line'
  10.     bar=notab(result)
  11.     if length(bar)>=len then foo=666
  12.     else do
  13.         'next-line'
  14.         foo=rc
  15.         end
  16.     end
  17. if foo~=666 then return 1
  18. exit
  19.  
  20. notab:procedure
  21. parse arg line
  22. tmp=1
  23. do until tmp=0
  24.     tmp=index(line,'09'x)
  25.     if tmp>0 then do
  26.         no=9-(tmp//8)
  27.         line=delstr(line,tmp,1)
  28.         line=insert(left("",no),line,tmp-1)
  29.         end
  30.     end
  31. return line
  32.